﻿using Microsoft.Xna.Framework;

namespace BlockeyEssentials.ScreenSystem.ScreenTypes
{
    public class ControllerSignInScreen : Screen
    {
        public ControllerSignInScreen(ScreenManager oManager)
            : base(oManager)
        {
            _Player1 = new PlayerInfo("Player 1", 1);
            _Player2 = new PlayerInfo("Player 2", 2);
            _Player3 = new PlayerInfo("Player 3", 3);
            _Player4 = new PlayerInfo("Player 4", 4);
        }

        #region Methods

        protected virtual void Select(ScreenManager oManager)
        {
            _Player1._IsReady = true;
        }

        protected virtual void Cancel(ScreenManager oManager)
        {
            _Player1._IsReady = false;
        }

        protected virtual void Finish(ScreenManager oManager)
        {
            if (PlayersAreReady)
            {
                Enabled = false;
                oManager.RemoveScreen(this);
            }
        }

        #endregion

        #region Properties

        public bool PlayersAreReady
        {
            get
            {
                return (_Player1._IsReady || _Player2._IsReady || _Player3._IsReady || _Player4._IsReady);
            }
        }

        #endregion

        protected PlayerInfo _Player1;
        protected PlayerInfo _Player2;
        protected PlayerInfo _Player3;
        protected PlayerInfo _Player4;
    }

}
